home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "*\A..\..\..\LIFESA~1\VBPROJ~1\EZPORT\ezport.vbp"
- Begin VB.Form EZPortFrm
- AutoRedraw = -1 'True
- Caption = "EZPort sample:"
- ClientHeight = 2760
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 3405
- BeginProperty Font
- Name = "Times New Roman"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- LinkTopic = "Form1"
- ScaleHeight = 2760
- ScaleWidth = 3405
- StartUpPosition = 3 'Windows Default
- Begin EZPortPrj.EZPort EZPort1
- Height = 525
- Index = 1
- Left = 1890
- TabIndex = 5
- Top = 2025
- Width = 1260
- _ExtentX = 2223
- _ExtentY = 926
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "Times New Roman"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- End
- Begin EZPortPrj.EZPort EZPort1
- Height = 525
- Index = 0
- Left = 45
- TabIndex = 4
- Top = 525
- Width = 1260
- _ExtentX = 2223
- _ExtentY = 926
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "Times New Roman"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- End
- Begin VB.CommandButton Command1
- Caption = "Get Color"
- Height = 495
- Left = 75
- TabIndex = 3
- Top = 1950
- Width = 1005
- End
- Begin VB.TextBox Text1
- Height = 315
- Left = 690
- TabIndex = 2
- Text = "1"
- Top = 1215
- Width = 270
- End
- Begin VB.ListBox List1
- Height = 510
- ItemData = "ezport.frx":0000
- Left = 2400
- List = "ezport.frx":000A
- TabIndex = 0
- Top = 1215
- Visible = 0 'False
- Width = 1020
- End
- Begin VB.Label Label3
- AutoSize = -1 'True
- Caption = "Click a port to connect:"
- Height = 225
- Left = 840
- TabIndex = 7
- Top = 60
- Width = 1845
- End
- Begin VB.Label Label2
- AutoSize = -1 'True
- Caption = "Port:"
- Height = 225
- Left = 165
- TabIndex = 6
- Top = 1230
- Width = 375
- End
- Begin VB.Line Line1
- Visible = 0 'False
- X1 = 2295
- X2 = 3180
- Y1 = 1020
- Y2 = 1050
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "Select target"
- ForeColor = &H00FF0000&
- Height = 225
- Left = 1680
- TabIndex = 1
- Top = 375
- Visible = 0 'False
- Width = 990
- End
- Attribute VB_Name = "EZPortFrm"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub Command1_Click()
- MsgBox EZPort1(0).GetPortColor(Text1)
- End Sub
- Private Sub EZPort1_Click(Index As Integer, Left As Long, top As Long, Port As Integer)
- Dim lngL As Long
- Dim lngT As Long
- With EZPort1(Index)
- lngL = .Left + Left
- lngT = .top + top
- Select Case .PortState(Port)
- Case stActive
- If Label1.Visible Then
- With Line1
- .X1 = List1.Left
- .Y1 = List1.top
- .X2 = lngL
- .Y2 = lngT
- .Visible = True
- .ZOrder
- End With
- Label1.Visible = False
- Else
- With List1
- .ZOrder
- .Left = lngL
- .top = lngT
- .Visible = True
- End With
- End If
- Case stInactive
- .PortState(Port) = stOff
- Case stOff
- .PortState(Port) = stActive
- List1.Visible = False
- End Select
- End With
- End Sub
- Private Sub Form_Load()
- ' EZPort(2).ZOrder 1
- End Sub
- Private Sub List1_Click()
- With List1
- Select Case .List(.ListIndex)
- Case "Connect"
- Label1.Visible = True
- Case "Disconnect"
- Call SetStatus(.Left, .top, stInactive)
- End Select
- .Visible = False
- End With
- End Sub
- Private Sub SetStatus(Left As Long, top As Long, status As PortStates)
- Dim intPort As Integer
- Dim intEZ As Integer
- Dim lngL As Long
- Dim lngT As Long
- Dim intX As Integer
- For intEZ = 0 To EZPort1.Count - 1
- With EZPort1(intEZ)
- For intX = 1 To .Ports
- Call .LocatePort(intX, lngL, lngT)
- If (Left = lngL + .Left) And (top = lngT + .top) Then
- .PortState(intX) = status
- End If
- Next
- End With
- Next
- End Sub
-